bin=httpserver
cgi=test_cgi 
cc=g++
curr=$(shell pwd)
LD_FLAGS=-std=c++11 -lpthread
src=main.cc
.PHONY:ALL
ALL:$(bin) CGI

$(bin):$(src)
	$(cc) -o $@ $^ $(LD_FLAGS)
CGI:
	cd $(curr)/cgi;\
	make;\ 
	cd -;
	//返回

.PHONY:clean
clean:
	rm -f $(bin) $(cgi)
	rm -rf output
	cd $(curr)/cgi;\
		make clean;\
		cd -
.PHONY:output 
output:
	mkdir -p output 
	cp $(bin) output 
	cp -rf wwwroot output 
	cp ./cgi/test_cgi output/wwwroot
	cp ./cgi/mysql_cgi output/wwwroot
	cp ./cgi/mysql_cgilog output/wwwroot
	cp ./cgi/calculate_cgi output/wwwroot
